﻿using SanJ.FreeCare.Localization;
using SanJ.FreeCare.Permissions;
using Volo.Abp.Localization;

namespace SanJ.FreeCare.Notifications
{
    public class AppNotificationProvider : NotificationProvider
    {
        public override void SetNotifications(INotificationDefinitionContext context)
        {
            context.Manager.Add(
                new NotificationDefinition(
                    AppNotificationNames.NewUserRegistered,
                    displayName: L("NewUserRegisteredNotificationDefinition"),
                    permissionDependency: new string[] { FreeCarePermissions.Pages_Administration_Users }
                    )
                ); 

            context.Manager.Add(
                new NotificationDefinition(
                    AppNotificationNames.NewTenantRegistered,
                    displayName: L("NewTenantRegisteredNotificationDefinition"),
                    permissionDependency: new string[] { FreeCarePermissions.Pages_Tenants }
                    )
                );
        }

        private static LocalizableString L(string name)
        {
            return LocalizableString.Create<FreeCareResource>(name);
        }
    }
}
